<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="timer"></div>
		<!-- <div id="warring"></div> -->
	</body>
	<script type="text/javascript">
		var maxtime = 24 * 60 * 60;
	      function CountDown() {
	        if (maxtime >= 0) {
	          let h = Math.floor(maxtime / 60 %24);
	          let minutes = Math.floor(maxtime / 60 % 60);
	          let seconds = Math.floor(maxtime % 60);
			  console.log(h,minutes,seconds)
	          msg = "距离结束还有"+h+"时"+ minutes + "分" + seconds + "秒";
	          document.all["timer"].innerHTML = msg;
	          // if (maxtime == 5 * 60)alert("距离结束仅剩5分钟");
	            --maxtime;
	        } else{
	          clearInterval(timer);
	          alert("时间到，结束!");
	        }
	      }
	      timer = setInterval("CountDown()", 1000);   
	 </script>
</html>
